import { EntryDef } from "../typings/index.js";

export const NumberLike = ['bigint', 'biguint', 'longlong', 'ulonglong', 'byte', 'char', 'uchar', 'double', 'float', 'int32', 'uint32', 'int16', 'uint16', 'int8', 'uint8', 'short', 'ushort', 'int', 'uint', 'smallint', 'smalluint', 'tinyint', 'tinyuint']
export const CharLike = ['byte', 'char', 'uchar'];
export const StringLike = ['string', 'String', 'time'];
export const BigintLike = ["bigint", "biguint", "ulonglong", "longlong"];
export const UlonglongLike = ["biguint", "ulonglong"];
export const LonglongLike = ["bigint", "longlong"];

export function isLiteralStringType(t: string): boolean {
    return t.toLowerCase() === 'string';
}

export function isComplexType(t: string): boolean {
    return !NumberLike.includes(t) && !StringLike.includes(t);
}

export function isArrayEntry(entry: EntryDef): boolean {
    return Boolean(entry._attributes.count) || Boolean(entry._attributes.refer);
}

export const cname_ClientUsed = 'ClientUsed';
export const name_ClientUsed = 'm_bClientUsed';
